<template>
    <div class="pb47 fs12" v-if="dataLists[0].post_title">
        <ul class="table_ul" v-if="dataLists[0].down_status == 2 ">
            <li v-for="(v,k) in dataLists" :key="k"
                class="disflex jusbet lh35 curpointer fs14 c333 table_li pt4 pb5 top18_before postionre">
                <div class="overell flex1 red_point postionre pl16 red_top15" @click="tableLiTap(k,v.down_status)">
                    <span v-html="v.post_title" class="fs16" :title="v.post_title"></span>
                    <p v-html="$removeHTMLTag(v.post_content)" class="fs12 c999 overell"></p>
                </div>
                <a :href="v.post_down" class="download lh30 pl11 pr8 fs14 cred time bred boradius1 top22 postionab" target="_blank">
                    <i class="iconfont icon-xiazai fs14 cred"></i>软件下载
                </a>
            </li>
        </ul>
        <ul class="table_ul" v-else>
            <li v-for="(v,k) in dataLists" :key="k"
                class="disflex jusbet lh60 curpointer fs14 c333 table_li"
                @click="tableLiTap(k)">
                <div class="overell flex1 hoverred pr38 red_point postionre pl16">
                    <span v-html="v.post_title" :title="v.post_title"></span>
                </div>
                <div class="time lh60 media_w100p textr media_lh30">
                    <span v-show="status==1" class="textr pr30">
                        <span class="pr21"  @click.stop="expectedTrend(1,v.id)" title="看涨">
                            <b class="iconfont icon-zhang cred fs18"></b>
                            <b v-html="v.up" ></b>
                        </span>
                        <span class="pr21"  @click.stop="expectedTrend(2,v.id)" title="看跌">
                            <b class="iconfont icon-die cgreen fs12"></b>
                            <b v-html="v.down"></b>
                        </span>
                        <span  @click.stop="expectedTrend(3,v.id)" title="看平">
                            <b class="iconfont icon-icon18 c666 fs12"></b>
                            <b v-html="v.flat"></b>
                        </span>
                    </span>
                    <span v-html="v.post_modified"></span>

                </div>
            </li>
        </ul>
    </div>

</template>

<script>
    export default {
        name: "Table",
        props:['dataLists','down','status'],
        methods:{
            tableLiTap(index,status){
                if(status == 2 ){return}
                this.$emit('tableLiTap',index)
            },
            expectedTrend(status,id){
                var v =this;
                this.$ExpectedTrends(status,id,function () {
                    v.$emit('refresh');
                });
            }
        },
        watch:{
            '$dataLists'(newVal,oldVal){
                console.log('$dataLists',newVal)
            }
        }
    }
</script>

<style>
    .table_ul .table_li:nth-child(2n+1){
        background: #fff;
    }
    .table_ul .table_li:nth-child(2n){
        background: #f5f5f5;
    }
    .table_li{
        padding-right: .28rem;
        width: 100%;
        padding-left: .28rem;
    }
    .red_point:before{
        content: '';
        position: absolute;
        left: 0;
        width: .06rem;
        height: .06rem;
        background: #bf000e;
        top: 0.28rem;
    }
    .red_top15.red_point:before{
        top: .15rem;
    }
    .table_li .time{
        right: .24rem;
    }
</style>
























